The invention relates to a method of acquiring images of an object implemented by an image acquisition system comprising at least one optical apparatus, that is able to process an acquired image for extracting at least one feature from said object.
In particular, the invention relates to acquisition systems comprising optical apparatuses that are able to acquire images of objects that are stationary and/or in transit on movable conveying means.
The invention further relates also to acquisition systems comprising movable optical apparatuses, i.e. apparatuses connected to a supporting base that is movable over time by successive movements between a plurality of different positions, that is able to acquire images of stationary objects. The optical apparatus in particular continuously changes orientation in space to acquire images of the object.
In the present description and in the subsequent claims the expression “optical apparatus for acquiring images” denotes an apparatus that is able to acquire images of an object arranged in a supporting surface, and in particular to acquire geometrical and/or shape features of said object, or optical information associated with said object.
The expression “optical information” denotes any graphic representation that constitutes information, whether coded or uncoded.
One example of coded information is a linear or two-dimensional optical code in which the data are coded that identify the object with which the optical code is associated. The information is coded by suitable combinations of elements of a preset shape, for example squares, rectangles or hexagons, of a dark (normally black) colour separated by light elements (normally white spaces), and barcodes, stacked codes and two-dimensional codes in general, colour codes, etc are known.
The term “optical information” further comprises, more in general, also other graphic shapes that include printed or handwritten characters (letters, numbers, etc) and particular shapes (so-called “patterns”), such as, for example, stamps, logos, signatures, finger prints, etc and any detectable graphic representation, not only in the field of visible light but also along the entire wave length comprised between infrared and ultraviolet.
In the prior art, in image acquisition systems, so-called “unattended scanning systems” are known that comprise digital cameras for acquiring the images of packages or objects in general that are stationary and/or in transit on a conveyor belt or on other supporting and/or handling and conveying means, and decoding by digital cameras the optical information printed or imposed thereupon. Such digital cameras, which comprise photosensors, can comprise one-dimensional or two-dimensional arrays of photosensors.
The expression “image processing” denotes the execution of an initial two-dimensional analysis of the acquired image in order to be able to process the image in greater detail subsequently.
This subsequent processing has the aim of “correctly extracting features of interest of the object”. In other words, this last expression denotes an image recognition algorithm that enables the optical information to be read and decoded correctly, however oriented, associated with the object and/or outlines or characters associated with the object to be identified.
Known image acquisition systems typically comprise an optical apparatus, at least one lighting device associated with this apparatus, a user interface graphic device for configuring the acquisition system and a control device for managing the lighting device and the optical apparatus itself.
One typical problem of such acquisition systems lies in the fact that because of the corresponding positioning between the object and the optical apparatus, the images of the object acquired by the optical apparatus are often perspectively distorted. It is in fact not always possible or advisable to arrange the optical axis of the apparatus opposite the object to be inspected, orthogonally to the face of the object on which the coded information is positioned, or more in general, of which it is necessary to acquire an image. If the lighting device is incorporated into and surrounds the optical apparatus, it is, for example, necessary to incline the surface to be analysed, to avoid direct reflections on the optical apparatus.
In the case of image acquisition systems with a fixed optical apparatus, the lack of space or points suitable for fixing to the resting base, constrains the positioning of the optical apparatus in relation to the object to be acquired in such a manner that this positioning is often not optimal from the point of view of the acquired image, which can be perspectively distorted.
On the other hand, in the case of image acquisition systems with a movable optical apparatus, for example mounted on a robot arm for “pick and place” applications, the optical apparatus continuously changes orientation in space, moving integrally with the robot arm. In these systems, the arrangement of the optical apparatus with respect to the object is determined not by the needs for optimum acquisition of images but by the needs of the robot arm. The acquired images can thus be perspectively distorted.
The perspective distortion of the object in the acquired image makes the image recognition and decoding algorithms much more complex and less efficient, with consequently lengthy processing times for decoding the image. Further, the distortion of the image can introduce decoding errors, owing to an incorrect interpretation of the optical information in the image.
For example, a graphic sign reproducing a character in a text could be interpreted incorrectly by an optical character recognition (OCR) algorithm. Similarly, a decoding error could take place if a first characteristic has to be extracted from an image positioned in a first region of interest that is identifiable by geometric parameters starting from a second region of interest. An alteration of this geometrical parameters for example the distance and/or the orientation between the first and/or the second region of interest due to the perspective distortion, could cause errors during the decoding step, as the first region of interest could be identified in a region in which the feature to be decoded is absent.
In order to overcome this problem, it is known to perform an image-processing step geometrically transforming the acquired image by an algorithm that is able to return the image to the actual non distorted proportions thereof, such as to extract features of interest of the object of the image transformed and not transformed by the acquired image.
This geometrical transformation provides for, for example, the use of algorithms based on the hypothesis that each point of the distorted image can be referred to a corresponding point of the actual image. A geometrical transformation algorithm needs the coordinates of certain suitably chosen points identified in the distorted image and in the transformed image to be able to be defined. Thus, an intervention by an operator is necessary during an optical apparatus configuration step so that the optical apparatus is able to define the geometrical transformation algorithm. The operator has in fact images at his disposal in which optical calibration images (also known as test patterns) are coded and by means of multiple acquisitions of such images provided with test patterns the geometrical transformation algorithm is defined.
This algorithm, identified in this configuration step of the optical apparatus, is subsequently used in a work step to process an image, which can be acquired subsequently, simultaneously, or also prior to this configuration step, transforming the image into a different image, before extracting the features of the object and thus decoding the image.
The image acquisition system thus requires the work step to be preceded by a configuration step of the optical apparatus during which the multiple acquisition of test patterns takes place and/or, for example, other operating parameters are set for the operation of the image acquisition system by means of the user interface graphic device (for example, it is also known to use the test patterns to determine the factor for converting pixels into mm).
This configuration procedure is laborious for the operator because of the multiple acquisitions of test patterns and further requires a not inconsiderable time in which the image acquisition system cannot be used automatically because it is in the configuration step.
This configuration time becomes critical if, in the case of a movable optical apparatus, it is necessary to identify all the possible work positions of the apparatus itself and, for each, define a corresponding geometrical transformation. In each possible work position, the multiple acquisitions of test patterns have to be repeated by test pattern and the configuration step is accordingly even more complex and longer.
Further, for a correct definition of the geometrical transformation algorithm and thus in order to effectively resolve perspective distortion, it is necessary for the correlation between the optical patterns, to be identified with great accuracy. This is all the more necessary the more the image is distorted perspectively.
In the presence of only a few test patterns the geometrical transformation is defined correctly only if the optical information is on an object having a planar surface, such as, for example, a label arranged on a face of a box-shaped body. In this specific case and in particular limit conditions, just one test pattern may be sufficient to define the geometrical transformation.
Nevertheless, defining this geometrical transformation becomes even longer to perform and difficult to solve if the object has a curved external surface. In fact, in the case of objects with curved or even irregular external surfaces not only are multiple acquisitions of calibration images with test pattern necessary but it is also necessary that such images are acquired from several positions in space. The first calibration image acquired is used to identify the calibration image on a reference surface, and subsequent test patterns on the other hand, are acquired by different spatial positions inside a work volume of interest and only then by the comparison between the calibration images of the test patterns acquired subsequently, that are possibly deformed perspectively during acquisition, with the test pattern of the first calibration image acquired it is thus possible to define the geometrical transformation. The time necessary for the operator to configure the optical apparatus and accordingly the image acquisition system increases even further.